<template>
  <div class="layout">
    <Layout :style="layout">
      <wsHead></wsHead>
      <Layout>
        <Sider hide-trigger style="background-color: #2C2E39">
        <wsMenu></wsMenu>
        </Sider>
        <Layout>
          <div style="height: 100%">
            <wsContent></wsContent>
          </div>
        </Layout>
      </Layout>
    </Layout>
  </div>
</template>

<script>

  import wsMenu from "./../common/menu.vue";
  import wsHead from "./../common/head.vue";
  import wsContent from "./../common/content.vue";
  import {getDict} from "../../api/sys/system/sysDictData";
  import {mapMutations} from "vuex";
  export default {
    name : 'sys',
    components: {
      wsMenu,
      wsHead,
      wsContent
    },
    data(){
      return {
        layout : {
          height : document.documentElement.clientHeight-2 + 'px',
          minWidth : '1250px'
        }
      }
    },
    mounted(){
      var thiz = this;
      window.onresize = function(){
        thiz.layout.height = document.documentElement.clientHeight-2 + 'px';
      }
      //获取数据字典数据
      this.getDictData();
    },
    methods : {
      ...mapMutations(['settingDictData']),
      getDictData(){
        getDict().then(result=>{
          var data = result.data;
          if(data){
            this.settingDictData(data);
          }
        });
      }
    }
  }
</script>

<!--<style scoped>-->
  <!--<Spin size="large" fix v-if="true"></Spin>-->
  <!--.layout{-->
    <!--border: 1px solid #d7dde4;-->
    <!--background: #f5f7f9;-->
    <!--position: relative;-->
    <!--border-radius: 4px;-->
    <!--overflow: hidden;-->
  <!--}-->
<!--</style>-->
